<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get information about a field</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.ibase-fetch-row.html">« ibase_fetch_row</a></li>
      <li style="float: right;"><a href="function.ibase-free-event-handler.html">ibase_free_event_handler »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.ibase.html">Firebird/InterBase 函数</a></li>
    <li>Get information about a field</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.ibase-field-info" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ibase_field_info</h1>
  <p class="verinfo">(PHP 5, PHP 7 &lt; 7.4.0)</p><p class="refpurpose"><span class="refname">ibase_field_info</span> &mdash; <span class="dc-title">Get information about a field</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ibase-field-info-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ibase_field_info</strong></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$result</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$field_number</code></span>): <span class="type">array</span></div>

  <p class="para rdfs-comment">
   Returns an array with information about a field after a select
   query has been run.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ibase-field-info-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">result</code></dt>

     <dd>

      <p class="para">
       An InterBase result identifier.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">field_number</code></dt>

     <dd>

      <p class="para">
       Field offset.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ibase-field-info-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an array with the following keys: <code class="literal">name</code>,
   <code class="literal">alias</code>, <code class="literal">relation</code>,
   <code class="literal">length</code> and <code class="literal">type</code>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ibase-field-info-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1229">
    <p><strong>示例 #1 <span class="function"><strong>ibase_field_info()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$rs&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;tablename"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$coln&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_num_fields</span><span style="color: #007700">(</span><span style="color: #0000BB">$rs</span><span style="color: #007700">);<br />for&nbsp;(</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">$coln</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$col_info&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_field_info</span><span style="color: #007700">(</span><span style="color: #0000BB">$rs</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"name:&nbsp;"</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$col_info</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">].&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"alias:&nbsp;"</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$col_info</span><span style="color: #007700">[</span><span style="color: #DD0000">'alias'</span><span style="color: #007700">].&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"relation:&nbsp;"</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$col_info</span><span style="color: #007700">[</span><span style="color: #DD0000">'relation'</span><span style="color: #007700">].&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"length:&nbsp;"</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$col_info</span><span style="color: #007700">[</span><span style="color: #DD0000">'length'</span><span style="color: #007700">].&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"type:&nbsp;"</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$col_info</span><span style="color: #007700">[</span><span style="color: #DD0000">'type'</span><span style="color: #007700">].&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ibase-field-info-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.ibase-num-fields.html" class="function" rel="rdfs-seeAlso">ibase_num_fields()</a> - Get the number of fields in a result set</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>